home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-01 / snip0493.zip / SCRNMACS.H < prev    next >
Text File  |  1993-04-05  |  1KB  |  46 lines

  1. /*
  2. **  Macros for managing direct video writes by Jerry Houston
  3. */
  4.  
  5. #if defined(__TURBOC__)
  6.  #define FAR far
  7. #else
  8.  #define FAR _far
  9. #endif
  10.  
  11. #ifndef MK_FP
  12.  #define MK_FP(seg,off) ((void far *)(((long)(seg) << 16)|(unsigned)(off)))
  13. #endif
  14.  
  15. /*
  16. **  Functions in VIDPORT.C in SNIPPETS
  17. */
  18.  
  19. void GotoXY(int col, int row);
  20. void ClrScrn(int vattrib);
  21.  
  22. #if !defined(COLORMODE)
  23.  #define COLORMODE  ((*(char FAR *)0x0449) != 7)
  24.  #define EXT_KBD    (*(char FAR *)0x0496 & 16)
  25.  #define VIDPAGE    (*((unsigned char far *)0x0462))
  26.  #define ROWSIZE    (*(int FAR *)0x044A)
  27.  #define SCANLINES  ((int)*(char FAR*)0x0461)
  28.  #define SCRBUFF    ((unsigned FAR *)((COLORMODE)?0xB8000000:0xB0000000))
  29.  #define SCREENSEG  ((_segment)((COLORMODE)?0xB800:0xB000))
  30.  #define SCREENSIZE ((*(int FAR *)0x044C) >> 1)
  31.  #define SCREENCOLS (*(int FAR *)0x044A)
  32.  #define SCREENROWS ((*(char FAR *)0x0484)?1+(*(char FAR *)0x0484):25)
  33. #endif
  34.  
  35. /*
  36.      COLORMODE  = true/false, are we using color?
  37.      EXT_KBD    = true/false, extended keyboard in use?
  38.      VIDPAGE    = current video page in use
  39.      SCANLINES  = number of scan lines in a character.
  40.      SCRBUFF    = returns B800:0000 if using color, B000:0000 if mono.
  41.      SCREENSEG  = when you just need the segment portion.
  42.      SCREENSIZE = number of (2-byte) cells required to save screen.
  43.      SCREENCOLS = number of columns, often 80.
  44.      SCREENROWS = number of rows, usually defaults to 25.
  45. */
  46.